// components/teacher-card.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    teacher: {
      type: Object
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    _age: 0
  },

  /**
   * 组件的方法列表
   */
  methods: {
    goToTeacher(){
      wx.navigateTo({
        url: `../../pages/teacher-detail/teacher-detail?_id=${this.properties.teacher._id}`,
      })
    },
    onPreviewImage(event) {
      const ds=event.target.dataset
      wx.previewImage({
        urls: [ds.imgsrc],
        current: ds.imgsrc
      })
    }
  }
})
